package com.linkhub.oms.data.sync.api.yunexpress.domain.response;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.List;

/**
 * @Description: 查询运单响应
 * @Author: Jaycle
 * @Date: 2024/06/30 16:41
 * @Version: 1.0
 */
@Data
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
public class GetOrderResponse extends YunExpressBaseResponse implements Serializable {

    @JSONField(serialize = false, deserialize = false)
    public boolean success() {
        return SUCCESS_CODE.equals(getCode()) && item != null;
    }

    @JSONField(name = "Item")
    private Item item;

    /**
     * code
     */
    @JSONField(name = "Code")
    private String code;

    /**
     * message
     */
    @JSONField(name = "Message")
    private String message;

    /**
     * requestId
     */
    @JSONField(name = "RequestId")
    private String requestId;

    /**
     * timeStamp
     */
    @JSONField(name = "TimeStamp")
    private String timeStamp;

    /**
     * Item
     */
    @NoArgsConstructor
    @Data
    public static class Item {
        /**
         * wayBillNumber
         */
        @JSONField(name = "WayBillNumber")
        private String wayBillNumber;

        /**
         * orderNumber
         */
        @JSONField(name = "OrderNumber")
        private String orderNumber;

        /**
         * shippingMethodCode
         */
        @JSONField(name = "ShippingMethodCode")
        private String shippingMethodCode;

        /**
         * trackingNumber
         */
        @JSONField(name = "TrackingNumber")
        private String trackingNumber;

        /**
         * transactionNumber
         */
        @JSONField(name = "TransactionNumber")
        private String transactionNumber;

        /**
         * length
         */
        @JSONField(name = "Length")
        private int length;

        /**
         * width
         */
        @JSONField(name = "Width")
        private int width;

        /**
         * height
         */
        @JSONField(name = "Height")
        private int height;

        /**
         * packageNumber
         */
        @JSONField(name = "PackageNumber")
        private int packageNumber;

        /**
         * weight
         */
        @JSONField(name = "Weight")
        private double weight;

        /**
         * weightUnits
         */
        @JSONField(name = "WeightUnits")
        private String weightUnits;

        /**
         * applicationType
         */
        @JSONField(name = "ApplicationType")
        private int applicationType;

        /**
         * returnOption
         */
        @JSONField(name = "ReturnOption")
        private int returnOption;

        /**
         * status
         */
        @JSONField(name = "Status")
        private int status;

        /**
         * insuranceType
         */
        @JSONField(name = "InsuranceType")
        private int insuranceType;

        /**
         * insureAmount
         */
        @JSONField(name = "InsureAmount")
        private double insureAmount;

        /**
         * sensitiveTypeID
         */
        @JSONField(name = "SensitiveTypeID")
        private int sensitiveTypeID;

        /**
         * sourceCode
         */
        @JSONField(name = "Source_Code")
        private String sourceCode;

        /**
         * chargeWeight
         */
        @JSONField(name = "ChargeWeight")
        private double chargeWeight;

        /**
         * barCodeNumber
         */
        @JSONField(name = "BarCodeNumber")
        private String barCodeNumber;

        /**
         * receiver
         */
        @JSONField(name = "Receiver")
        private Receiver receiver;

        /**
         * sender
         */
        @JSONField(name = "Sender")
        private Sender sender;

        /**
         * parcels
         */
        @JSONField(name = "Parcels")
        private List<Parcel> parcels;

        /**
         * Receiver
         */
        @NoArgsConstructor
        @Data
        public static class Receiver {
            /**
             * certificateCode
             */
            @JSONField(name = "CertificateCode")
            private String certificateCode;

            /**
             * certificateType
             */
            @JSONField(name = "CertificateType")
            private String certificateType;

            /**
             * taxId
             */
            @JSONField(name = "TaxId")
            private String taxId;

            /**
             * countryCode
             */
            @JSONField(name = "CountryCode")
            private String countryCode;

            /**
             * firstName
             */
            @JSONField(name = "FirstName")
            private String firstName;

            /**
             * lastName
             */
            @JSONField(name = "LastName")
            private String lastName;

            /**
             * company
             */
            @JSONField(name = "Company")
            private String company;

            /**
             * street
             */
            @JSONField(name = "Street")
            private String street;

            /**
             * streetAddress1
             */
            @JSONField(name = "StreetAddress1")
            private String streetAddress1;

            /**
             * streetAddress2
             */
            @JSONField(name = "StreetAddress2")
            private String streetAddress2;

            /**
             * city
             */
            @JSONField(name = "City")
            private String city;

            /**
             * state
             */
            @JSONField(name = "State")
            private String state;

            /**
             * zip
             */
            @JSONField(name = "Zip")
            private String zip;

            /**
             * phone
             */
            @JSONField(name = "Phone")
            private String phone;

            /**
             * mobileNumber
             */
            @JSONField(name = "MobileNumber")
            private String mobileNumber;

            /**
             * houseNumber
             */
            @JSONField(name = "HouseNumber")
            private String houseNumber;

            /**
             * email
             */
            @JSONField(name = "Email")
            private String email;
        }

        /**
         * Sender
         */
        @NoArgsConstructor
        @Data
        public static class Sender {
            /**
             * countryCode
             */
            @JSONField(name = "CountryCode")
            private String countryCode;

            /**
             * firstName
             */
            @JSONField(name = "FirstName")
            private String firstName;

            /**
             * lastName
             */
            @JSONField(name = "LastName")
            private String lastName;

            /**
             * company
             */
            @JSONField(name = "Company")
            private String company;

            /**
             * street
             */
            @JSONField(name = "Street")
            private String street;

            /**
             * city
             */
            @JSONField(name = "City")
            private String city;

            /**
             * state
             */
            @JSONField(name = "State")
            private String state;

            /**
             * zip
             */
            @JSONField(name = "Zip")
            private String zip;

            /**
             * phone
             */
            @JSONField(name = "Phone")
            private String phone;

            /**
             * houseNumber
             */
            @JSONField(name = "HouseNumber")
            private String houseNumber;

            /**
             * fax
             */
            @JSONField(name = "Fax")
            private String fax;

            /**
             * email
             */
            @JSONField(name = "Email")
            private String email;

            /**
             * psaId
             */
            @JSONField(name = "PsaId")
            private String psaId;

            /**
             * mobileNumber
             */
            @JSONField(name = "MobileNumber")
            private String mobileNumber;
        }

        /**
         * Parcel
         */
        @NoArgsConstructor
        @Data
        public static class Parcel {
            /**
             * invoiceId
             */
            @JSONField(name = "InvoiceId")
            private int invoiceId;

            /**
             * sku
             */
            @JSONField(name = "Sku")
            private String sku;

            /**
             * eName
             */
            @JSONField(name = "EName")
            private String eName;

            /**
             * cName
             */
            @JSONField(name = "CName")
            private String cName;

            /**
             * hsCode
             */
            @JSONField(name = "HsCode")
            private String hsCode;

            /**
             * quantity
             */
            @JSONField(name = "Quantity")
            private int quantity;

            /**
             * unitPrice
             */
            @JSONField(name = "UnitPrice")
            private double unitPrice;

            /**
             * unitWeight
             */
            @JSONField(name = "UnitWeight")
            private double unitWeight;

            /**
             * remark
             */
            @JSONField(name = "Remark")
            private String remark;

            /**
             * productUrl
             */
            @JSONField(name = "ProductUrl")
            private String productUrl;

            /**
             * invoiceRemark
             */
            @JSONField(name = "InvoiceRemark")
            private String invoiceRemark;

            /**
             * currencyCode
             */
            @JSONField(name = "CurrencyCode")
            private String currencyCode;

            /**
             * attachment
             */
            @JSONField(name = "Attachment")
            private String attachment;

            /**
             * invoicePart
             */
            @JSONField(name = "InvoicePart")
            private String invoicePart;

            /**
             * invoiceUsage
             */
            @JSONField(name = "InvoiceUsage")
            private String invoiceUsage;

            /**
             * classCode
             */
            @JSONField(name = "ClassCode")
            private String classCode;

            /**
             * brand
             */
            @JSONField(name = "Brand")
            private String brand;

            /**
             * modelType
             */
            @JSONField(name = "ModelType")
            private String modelType;

            /**
             * unit
             */
            @JSONField(name = "Unit")
            private String unit;

            /**
             * chargeFees
             */
            @JSONField(name = "ChargeFees")
            private String chargeFees;

            /**
             * auditStatus
             */
            @JSONField(name = "AuditStatus")
            private String auditStatus;

            /**
             * hsTaxRate
             */
            @JSONField(name = "HsTaxRate")
            private String hsTaxRate;

            /**
             * certificateRemark
             */
            @JSONField(name = "CertificateRemark")
            private String certificateRemark;

            /**
             * categoryCode
             */
            @JSONField(name = "CategoryCode")
            private String categoryCode;

            /**
             * categoryName
             */
            @JSONField(name = "CategoryName")
            private String categoryName;

            /**
             * extend
             */
            @JSONField(name = "Extend")
            private String extend;
        }
    }
}
